package com.demo.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @Description 测试过滤器2
 * @Author Dang Xianyue
 * @Date 2020-08-08 12:09
 * @Version 1.0
 */
public class TestFilter2 implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        System.out.println("TestFilter2: doSomething...");
        HttpServletRequest request=(HttpServletRequest)servletRequest;
        System.out.println("自定义测试过滤器filter2触发,拦截url:"+request.getRequestURI());
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
